package com.sjn.Client;


import java.util.Scanner;


public class client {
    public static void main(String[] args) {
        //主程序控制
        boolean first = true;
        Scanner sc=new Scanner(System.in);
        //创建服务
        StartService cpu =null;
        StartService arm =null;
        StartService screen =null;
        StartService camera =null;
        //操作界面
        while(first){
            System.out.println("-----菜单-----");
            System.out.println("按1开始制作芯片");
            System.out.println("按2开始制作内存条");
            System.out.println("按3开始制作屏幕");
            System.out.println("按4开始制作相机");
            System.out.println("按5查看当前制作进度");
            System.out.println("按6结束制作进程");


            //创建子进程
            int proess = sc.nextInt();
            if (proess==6){
                System.out.println("主程序结束!感谢使用");
                break;
            }
            //制作cpu
           else if (proess==1) {
                cpu = new cpustart();
                cpu.start(proess);


            }
            //制作内存条
           else if (proess==2) {

                arm = new armstart();
                arm.start(proess);

            }

            //制作屏幕
            else if (proess==3) {

               screen = new screenstart();
               screen.start(proess);

            }
            //制作相机
            else if(proess==4){
                camera = new camerastart();
                camera.start(proess);
            }
            //查看进度
            else if(proess==5){
                if (cpu!=null)
                    System.out.println(cpu.toString());
                if (arm!=null)
                    System.out.println(arm.toString());

                if (screen!=null)
                    System.out.println(screen.toString());

                if (camera!=null)
                    System.out.println(camera.toString());
                if (cpu==null&&arm==null&&screen==null&&camera==null){
                    System.out.println("当前未开始制作!!!!!!");
                }

            }
            }
        }

    }

